#include "Config.h"
#include "GPIO.h"
#include "Delay.h"
#include "UART.h"
#include "Exti.h"
#include "NVIC.h"
#include "Switch.h"

#include "usb.h"
#include "usb_req_class.h"
#include "MatrixKeys.h"
#include "WS2812B.h"
#include "KeyBoard.h"

#define TASK_KEYBOARD  1	
#define TASK_WS2812B   2

void GPIO_config(void) {
}


void sys_init(){
		EAXSFR();    //扩展寄存器访问使能
    GPIO_config();

		
		usb_init();
    EA = 1;  
}

void task_main() _task_ 0{
    sys_init();
	
		os_create_task(TASK_KEYBOARD);
		os_create_task(TASK_WS2812B);
	
    os_delete_task(0);
}

void task_keyboard() _task_ TASK_KEYBOARD{
		KeyBoard_init();
		while(1){
				scan_and_send();
				os_wait2(K_TMO, 2);
		}
}

void task_ws2812b() _task_ TASK_WS2812B{
		WS_init(19);
		Light_WS2812B();
}



